﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json.Linq;

namespace MvcApplication1.Controllers
{
    class Product
    {
        public Product()
        { 
        
        }
        public Product(string json)
        {
            JObject jObject = JObject.Parse(json);
            Name = (string)jObject["Name"];
            Expiry = (DateTime)jObject["Expiry"];
            Price = (decimal)jObject["Price"];
            Sizes = jObject["Sizes"].ToArray();
        }

        public string Name { get; set; }

        public DateTime Expiry { get; set; }

        public decimal Price { get; set; }

        public Array Sizes { get; set; }
    }
}
